import { AfterViewInit, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { Istudent } from 'src/app/istudent';
import { StudentListComponent } from '../student-list/student-list.component';

@Component({
  selector: 'app-student-detail',
  templateUrl: './student-detail.component.html',
  styleUrls: ['./student-detail.component.scss']
})
export class StudentDetailComponent {
  
  @Input()
  student:Istudent|undefined={
    img: '',
    name: '',
    age: 0,
    intersting: [],
    shuxue: 0,
    yuwen: 0,
    yinyu: 0,
    pingjun: 0,
    zongchegnji: 0,
    beizhu: '',
    sexy: ''
  }
  // 关闭事件
  @Output()
  dialogClose:EventEmitter<boolean>=new EventEmitter<boolean>();
  close:()=>void=()=>{
    this.dialogClose.emit(false);
    this.studentListComponent!.selectStudent=undefined;
  }

  @Input()
  studentListComponent:StudentListComponent|undefined=undefined;

  ngOnInit(): void {
    this.student=this.studentListComponent?.selectStudent;
  }


    
}
